package com.medica.ledproject.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

/**
 * @author xiaona
 * @date 2024/9/18
 * @description TODO
 */
public class JsonData {
    public static JSONObject login(){
        JSONObject data=new JSONObject();
        data.put("code",0);
        data.put("data","11111111111111");
        data.put("message","ok");
        return data;
    }
    public static JSONObject UploadMusic(){
        JSONObject data=new JSONObject();
        data.put("code",0);
        JSONObject d=new JSONObject();
        d.put("filename","bec68129-6a38-499c-9320-bd640bc6d8a0");
        d.put("showName","凤凰传奇 - 飞天");
        d.put("id","1");
        d.put("fileFormat","ma3");
        data.put("data",d);
        data.put("message","ok");
        return data;
    }
    public static JSONObject getMusicList(){
        JSONObject data=new JSONObject();
        data.put("code",0);
        data.put("message","ok");
        JSONObject d1=new JSONObject();
        JSONArray list=new JSONArray();
        for(int i=0;i<8;i++) {
            JSONObject d = new JSONObject();
            d.put("filename", "bec68129-6a38-499c-9320-bd640bc6d8a0");
            d.put("showName", "凤凰传奇 - 飞天"+i);
            d.put("id", i+1);
            d.put("fileFormat", "mp3");
            list.add(d);
        }
        d1.put("items",list);
        d1.put("count",8);
        d1.put("limit",10);
        d1.put("page",1);
        data.put("data",d1);
        return data;
    }
    public static JSONObject delMusic(){
        JSONObject data=new JSONObject();
        data.put("code",0);
        data.put("message","ok");
        return data;
    }
    public static JSONObject addToPlay(){
        JSONObject data=new JSONObject();
        data.put("code",0);
        data.put("message","ok");
        JSONObject d1=new JSONObject();
        d1.put("name","测试");
        d1.put("id",11);
        data.put("data",d1);

        return data;
    }
    public static JSONObject getPlayList(){
        JSONObject data=new JSONObject();
        data.put("code",0);
        data.put("message","ok");
        JSONObject d1=new JSONObject();
        JSONArray list=new JSONArray();
        for(int i=0;i<3;i++) {
            JSONObject t=new JSONObject();
            t.put("name","测试");
            t.put("id",i+1);
            JSONArray b=new JSONArray();
            for(int e=0;e<2;e++) {
                JSONObject d = new JSONObject();
                d.put("filename", "bec68129-6a38-499c-9320-bd640bc6d8a0");
                d.put("showName", "凤凰传奇 - 飞天");
                d.put("id", e + 1);
                d.put("fileFormat", "mp3");
                b.add(d);
            }
            t.put("musics",b);
            list.add(t);
        }
        d1.put("items",list);
        d1.put("count",8);
        d1.put("limit",10);
        d1.put("page",1);
        data.put("data",d1);

        return data;
    }
    public static JSONObject delPlayList(){
        JSONObject data=new JSONObject();
        data.put("code",0);
        data.put("message","ok");
        return data;
    }
    public static JSONObject getPhoneList(){
        JSONObject data=new JSONObject();
        data.put("code",0);
        data.put("message","ok");
        JSONArray list=new JSONArray();
        for (int i=0;i<3;i++){
            JSONObject d=new JSONObject();
            d.put("extension","100"+i);
            d.put("name","100"+i);
            d.put("uri","sip:1000192.168.3.140:5060");
            list.add(d);
        }
        data.put("data",list);
        return data;
    }
    public static JSONObject palyMusic(){
        JSONObject data=new JSONObject();
        data.put("code",0);
        data.put("message","ok");

        return data;
    }
    public static JSONObject getTaskList() {
        JSONObject data = new JSONObject();
        data.put("code",0);
        data.put("message", "ok");
        JSONArray list = new JSONArray();
        for (int i = 0; i < 1; i++) {
            JSONObject d = new JSONObject();
            d.put("uuid", "1111");
            d.put("name", "ceshi");
            d.put("extensions", "执行分机组");
            d.put("playListID", "执行分机组");
            d.put("playListName", "执行分机组");
            d.put("type", "now");
            JSONObject r = new JSONObject();
            r.put("playCount", 1);
            r.put("playName", "播放列表名称");
            r.put("extensions", "正在执行任务的分机组");
            d.put("running", r);
            JSONArray b = new JSONArray();
            for (int e = 0; e < 2; e++) {
                JSONObject q = new JSONObject();
                q.put("filename", "bec68129-6a38-499c-9320-bd640bc6d8a0");
                q.put("showName", "凤凰传奇 - 飞天");
                q.put("id", e + 1);
                q.put("fileFormat", "mp3");
                b.add(q);
            }
            d.put("musics", b);
            list.add(d);
        }
        data.put("data",list);
        return data;
    }
    public static JSONObject delTask(){
        JSONObject data=new JSONObject();
        data.put("code",0);
        data.put("message","ok");
        return data;
    }

}
